home *** CD-ROM | disk | FTP | other *** search
- // Quickie example C file for PMODE v3.0 extender for Borland C++ 4.0.
- // It is just a simple little file that demonstrates some things.
- // Notice that no C libraries are used.
-
- #include "pmode.h"
-
- DWORD screen_base;
-
- void putstring (int x, int y, char *str);
-
- void PMmain (void)
- {
- int a;
-
- // set base of text screen
- screen_base = 0xb8000 - lowbase;
-
- // clear text screen
- for (a = 0; a < 25*80; ((WORD *)screen_base)[a++] = 0x720);
-
- // put some strings to screen
- putstring (0, 0, "Hello World from Protected Mode...");
- putstring (10, 10, "Press any key to exit...");
-
- // wait for keypress, then exit
- asm
- {
- xor ah,ah
- int 16h
- }
- }
-
- void putstring (int x, int y, char *str)
- {
- char *screen_out = (void *)(screen_base + 80*2*y + 2*x - 2);
-
- while (screen_out+=2, *screen_out = *(str++));
- }
-
-